import fetch from 'common/src/utils/fetch';

export function getList(data) {
    return fetch({
        url: '/api/majorservice/voluntaryInfoBetween/voluntaryInfoBetweenPage',
        method: 'post',
        headers: {
            'Content-Type': 'application/json'
        },
        data
    });
}

export function getInnerList(id) {
    return fetch({
        url: '/api/majorservice/voluntaryInfoClass/findVoluntaryInfoClassVoById?id=' + id,
        method: 'get',
        headers: {
            'Content-Type': 'application/json'
        },
    });
}

export function getCrossList(id) {
    return fetch({
        url: '/api/majorservice/voluntaryInfoCross/findVoluntaryInfoCrossVoById?id=' + id,
        method: 'get',
        headers: {
            'Content-Type': 'application/json'
        },
    });
}

export function findVoluntaryMajor(data) {
    return fetch({
        url: '/api/majorservice/enrolPlan/findVoluntaryInfoClassVoById',
        method: 'post',
        headers: {
            'Content-Type': 'application/json'
        },
        data: data
    });
}

export function insertVolunteer(data) {
    return fetch({
        url: '/api/majorservice/voluntaryInfoBetween/insertvoluntaryInfoBetween',
        method: 'post',
        headers: {
            'Content-Type': 'application/json'
        },
        data: data
    });
}


export function isScholarShip(data) {
    return fetch({
        url: '/api/majorservice/scholarship/findOneByStudentId?studentId',
        method: 'post',
        headers: {
            'Content-Type': 'application/json'
        },
        data: data
    });
}


export function findCrossMajor(data) {
    return fetch({
        url: '/api/majorservice/enrolPlan/findVoluntaryMajor',
        method: 'post',
        headers: {
            'Content-Type': 'application/json'
        },
        data: data
    });
}

export function exportMainList(data) {
    return fetch({
        url: '/api/majorservice/voluntaryInfoBetween/excelvoluntaryInfoBetween',
        method: 'post',
        headers: {
            'Content-Type': 'application/json'
        },
        data: data
    });
}

export function exportInnerList(data) {
    return fetch({
        url: '/api/majorservice/voluntaryInfoBetween/excelvoluntaryInfoBetween',
        method: 'post',
        headers: {
            'Content-Type': 'application/json'
        },
        data: data
    });
}

export function exportCrossList(data) {
    return fetch({
        url: '/api/majorservice/voluntaryInfoBetween/excelvoluntaryInfoBetween',
        method: 'post',
        headers: {
            'Content-Type': 'application/json'
        },
        data: data
    });
}

export function getReportStatus(key) {
    return fetch({
        url: `/api/majorservice/common/exportExcelResult/${key}`,
        method: 'get'
    });
}

// 根据年级查专业大类
export function getMajorByGrade(data) {
    return fetch({
        url: '/api/welcomeservice/tutorSchool/major/' + data,
        method: 'get',
        headers: {
            'Content-Type': 'application/json'
        },
        data
    });
}

// 根据年级和专业查专业方向
export function getDirection(gradeId, subjectId) {
    return fetch({
        url: '/api/majorservice/voluntaryInfoBetween/findDirectionList?gradeId=' + gradeId + '&subjectId=' + subjectId,
        method: 'get',
        headers: {
            'Content-Type': 'application/json'
        },
    });
}

export function exportVoluntaryDirection(data) {
  return fetch({
    url: '/api/majorservice/voluntaryInfoBetween/exportVoluntaryDirection',
    method: 'post',
    headers: {
      'Content-Type': 'application/json'
    },
    data: data
  });
}

//类内学籍异动
export function changeStudentStatus(data) {
  return fetch({
    url: '/api/majorservice/interResultRank/changeStudentStatus',
    method: 'post',
    headers: {
      'Content-Type': 'application/json'
    },
    data: data
  });
}

//类内全部异动
export function changeBatchStudentStatus(data) {
  return fetch({
    url: '/api/majorservice/interResultRank/changeBatchStudentStatus',
    method: 'post',
    headers: {
      'Content-Type': 'application/json'
    },
    data: data
  });
}

//重置类内志愿填报
export function translateByStudentId(data) {
    return fetch({
        url: '/api/majorservice/voluntaryInfoClass/translateVoluntaryInfoClassByStudentId?studentId',
        method: 'post',
        headers: {
            'Content-Type': 'application/json'
        },
        data: data
    });
}



export function getPhoneNumber() {
    return fetch({
        url: '/api/majorservice/voluntaryInfoBetween/getPhoneNumber',
        method: 'get',
        headers: {
            'Content-Type': 'application/json'
        },
    });
}

export function updatePhoneNumber(data) {
    return fetch({
        url: '/api/majorservice/voluntaryInfoBetween/updatePhoneNumber?phoneNumber='+data,
        method: 'get',
        headers: {
            'Content-Type': 'application/json'
        },
    });
}